package Controls
{
	import Input.GameInput;
	
	import Objects.GameBitmap;
	import Objects.GameSprite;
	
	import flash.display.BitmapData;
	import flash.geom.Rectangle;

	public class Slider extends GameSprite
	{
		public var slider:Button;
		protected var dragRect:Rectangle;
		public var full:GameBitmap;
		protected var fullImage:BitmapData;
		public var track:GameBitmap;
		private var lastPercent:Number=0;
		public function Slider()
		{
			super();
			
			intelligent=true;
			
			track=new GameBitmap();
			addChild(track);
			
			full=new GameBitmap();
			addChild(full);
			
			slider=new Button();
			addChild(slider);
			
			dragRect=new Rectangle();
		}
		override protected function $update():void
		{
			if(GameInput.i.mDown)
			{
				if(mOver)
				{
					slider.sprite.startDrag(false,dragRect);
				}
			}
			else
			{
				slider.sprite.stopDrag();
			}
			var _percent:Number=percent;
			if(lastPercent!=_percent)
			{
				syncFull(_percent);
				lastPercent=_percent;
			}
		}
		public function get percent():Number
		{
			return 0;
		}
		public function set percent(value:Number):void
		{
			
		}
		public function setup(width:Number,height:Number,border:int=1):void
		{
			
		}
		protected function syncFull(_percent:Number):void
		{
			
		}
	}
}